CMAKE_MINIMUM_REQUIRED(VERSION 2.8.1)

FIND_PACKAGE(OpenGL REQUIRED)
if(NOT OPENGL_FOUND)
	message("ERROR: OpenGL not found")
endif(NOT OPENGL_FOUND)
MESSAGE(STATUS "OpenGL: ${OPENGL_LIBRARIES}")

FIND_PACKAGE(SDL REQUIRED)
if(NOT SDL_FOUND)
	message("ERROR: SDL not found")
endif(NOT SDL_FOUND)
MESSAGE(STATUS "SDL: ${SDL_LIBRARY}")

FIND_PACKAGE(SDL_image REQUIRED)
if(NOT SDLIMAGE_FOUND)
	message("ERROR: SDL_image not found")
endif(NOT SDLIMAGE_FOUND)
MESSAGE(STATUS "SDL_image: ${SDLIMAGE_LIBRARY}")

PROJECT(libawui)

if(UNIX)
	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++0x")
endif()

INCLUDE_DIRECTORIES(
	/usr/include/cairo/
	.
	${SDL_INCLUDE_DIR}
#	"C:\\awui-project\\cairo\\include\\cairo\\"
)


FILE(GLOB_RECURSE LIBAWUI_SOURCES awui/*.cpp )
FILE(GLOB_RECURSE LIBAWUI_HEADERS awui/*.h )

SOURCE_GROUP("Source" FILES ${LIBAWUI_SOURCES})
SOURCE_GROUP("Headers" FILES ${LIBAWUI_HEADERS})

ADD_LIBRARY(awui SHARED ${LIBAWUI_SOURCES} ${LIBAWUI_HEADERS})
ADD_LIBRARY(awui_static STATIC ${LIBAWUI_SOURCES} ${LIBAWUI_HEADERS})

TARGET_LINK_LIBRARIES(
	awui
	cairo
	${SDL_LIBRARY}
	${SDLIMAGE_LIBRARY}
# Valores para linux
	GL
#	"C:\\awui-project\\cairo\\lib\\libcairo.dll.a"
)
